package com.guonima;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

// EnableHystrix 注解开始hystrix功能
// EnableHystrixDashboard 注解启用图形界面看 EnableHystrix 的监控数据
@EnableHystrix
@EnableEurekaClient
@EnableHystrixDashboard
@SpringBootApplication
public class EurekaHystrixRibbonApplication {

	public static void main(String[] args) {
		SpringApplication.run(EurekaHystrixRibbonApplication.class, args);
	}


	@Bean
	@LoadBalanced
	public RestTemplate restTemplate(){
		return new RestTemplate();
	}

}